#include"../lib_include/TcpServer.h"

class EchoServer
{
 public:
  EchoServer(netlib::net::EventLoop* loop,
             const netlib::net::InetAddress& listenAddr);

  void start();  // calls server_.start();

 private:
  void onConnection(const netlib::net::TcpConnectionPtr& conn);

  void onMessage(const netlib::net::TcpConnectionPtr& conn,
                 netlib::net::Buffer* buf,
                 netlib::Timestamp time);

  netlib::net::TcpServer server_;
};
